﻿Imports System.Diagnostics.Contracts
Imports CookComputing.XmlRpc
Imports System.Security.Cryptography.X509Certificates
Imports System.Net
Imports System.Text

Namespace XmlRpc.Interfaces

    ''' <summary>
    ''' Defines general methods to retrieve media information.
    ''' </summary>
    ''' <remarks></remarks>
    <XmlRpcUrl("http://api.fotolia.com/Xmlrpc/rpc")>
    Public Interface IMediaData
        Inherits IFotoliaBase

#Region "xmlrpc.test"
        ''' <summary>
        ''' This method is a test method which returns success if connection is valid.
        ''' </summary>
        ''' <param name="apiKey">Authentication.</param>
        ''' <returns></returns>
        ''' <remarks>You need a valid api key to use the API</remarks>
        <XmlRpcMethod("xmlrpc.test")>
        Function Test(apiKey As XmlRpc.Authentication) As XmlRpcStruct

        ''' <summary>
        ''' This method is a test method which returns success if connection is valid using Async mode.
        ''' </summary>
        ''' <param name="apiKey">Authentication.</param>
        ''' <returns></returns>
        ''' <remarks>You need a valid api key to use the API</remarks>
        <XmlRpcBegin("xmlrpc.test")>
        Function BeginTest(apiKey As XmlRpc.Authentication, acb As AsyncCallback) As IAsyncResult

        ''' <summary>
        ''' This method is a test method which returns success if connection is valid using Async mode.
        ''' </summary>
        ''' <param name="apiKey">Authentication.</param>
        ''' <returns></returns>
        ''' <remarks>You need a valid api key to use the API</remarks>
        <XmlRpcBegin("xmlrpc.test")>
        Function BeginTest(apiKey As XmlRpc.Authentication, acb As AsyncCallback, state As Object) As IAsyncResult

        ''' <summary>
        ''' This method implements the End part of BeginTest method.
        ''' </summary>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <XmlRpcEnd("xmlrpc.test")>
        Function EndTest(iasr As IAsyncResult) As XmlRpcStruct
#End Region

#Region "xmlrpc.getData"

        ''' <summary>
        ''' This methods returns fotolia data.
        ''' </summary>
        ''' <param name="apiKey">The API key.</param>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <XmlRpcMethod("xmlrpc.getData")>
        Function GetData(apiKey As XmlRpc.Authentication) As XmlRpcStruct


        ''' <summary>
        ''' This methods returns fotolia data using async pattern.
        ''' </summary>
        ''' <param name="apiKey">The API key.</param>
        ''' <param name="acb">The async callback.</param>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <XmlRpcBegin("xmlrpc.getData")>
        Function BeginGetData(apiKey As XmlRpc.Authentication, acb As AsyncCallback) As IAsyncResult

        ''' <summary>
        ''' This methods returns fotolia data using async pattern.
        ''' </summary>
        ''' <param name="apiKey">The API key.</param>
        ''' <param name="acb">The async callback.</param>
        ''' <param name="state">The object state.</param>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <XmlRpcBegin("xmlrpc.getData")>
        Function BeginGetData(apiKey As XmlRpc.Authentication, acb As AsyncCallback, state As Object) As IAsyncResult

        ''' <summary>
        ''' Implements the End part of async pattern.
        ''' </summary>
        ''' <param name="iasr">The async result instance.</param>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <XmlRpcEnd("xmlrpc.getData")>
        Function EndGetData(iasr As IAsyncResult) As XmlRpcStruct
#End Region

#Region "xmlrpc.getMediaData"
        ''' <summary>
        ''' This method return all information about a media.
        ''' </summary>
        ''' <param name="apiKey">You need a valid api key to use the API</param>
        ''' <param name="id">Unique media id</param>
        ''' <param name="thumbnail_size">Thumbnail size (30,110, 400)</param>
        ''' <param name="language_id">Language Id</param>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <XmlRpcMethod("xmlrpc.getMediaData")>
        Function GetMediaData(apiKey As XmlRpc.Authentication, id As Integer, thumbnail_size As Integer, language_id As Integer) As XmlRpcStruct

        ''' <summary>
        ''' This method return all information about a media.
        ''' </summary>
        ''' <param name="apiKey">You need a valid api key to use the API</param>
        ''' <param name="id">Unique media id</param>
        ''' <param name="thumbnail_size">Thumbnail size (30,110, 400)</param>
        ''' <param name="language_id">Language Id</param>
        ''' <param name="acb">The async callback to manage results.</param>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <XmlRpcBegin("xmlrpc.getMediaData")>
        Function BeginGetMediaData(apiKey As XmlRpc.Authentication,id As Integer, thumbnail_size As Integer, language_id As Integer,acb As AsyncCallback) As IAsyncResult

        ''' <summary>
        ''' This method return all information about a media.
        ''' </summary>
        ''' <param name="apiKey">You need a valid api key to use the API</param>
        ''' <param name="id">Unique media id</param>
        ''' <param name="thumbnail_size">Thumbnail size (30,110, 400)</param>
        ''' <param name="language_id">Language Id</param>
        ''' <param name="acb">The async callback to manage results</param>
        ''' <param name="state">The user state.</param>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <XmlRpcBegin("xmlrpc.getMediaData")>
        Function BeginGetMediaData(apiKey As XmlRpc.Authentication, id As Integer, thumbnail_size As Integer, language_id As Integer, acb As AsyncCallback, state As Object) As IAsyncResult

        ''' <summary>
        ''' The end part of Begin method.
        ''' </summary>
        ''' <param name="iasr">The async result used to retrieve method results.</param>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <XmlRpcEnd("xmlrpc.getMediaData")>
        Function EndGetMediaData(iasr As IAsyncResult) As XmlRpcStruct
#End Region

#Region "xmlrpc.getMediaGalleries"
        ''' <summary>
        ''' This methods return galleries for a media. 
        ''' </summary>
        ''' <param name="apiKey">You need a valid api key to use the API.</param>
        ''' <param name="id">Search by media id.</param>
        ''' <param name="thumbnail_size">The thumbnail size (30, 110, 400).</param>
        ''' <param name="language_id">The language id.</param>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <XmlRpcMethod("xmlrpc.getMediaGalleries")>
        Function GetMediaGalleries(apiKey As XmlRpc.Authentication, id As Integer, language_id As Integer, thumbnail_size As Integer) As XmlRpcStruct()

        ''' <summary>
        ''' This methods return galleries for a media (async mode). 
        ''' </summary>
        ''' <param name="apiKey">You need a valid api key to use the API.</param>
        ''' <param name="id">Search by media id.</param>
        ''' <param name="thumbnail_size">The thumbnail size (30, 110, 400).</param>
        ''' <param name="language_id">The language id.</param>
        ''' <param name="acb">The async callback.</param>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <XmlRpcBegin("xmlrpc.getMediaGalleries")>
        Function BeginGetMediaGalleries(apiKey As XmlRpc.Authentication, id As Integer, language_id As Integer, thumbnail_size As Integer, acb As AsyncCallback) As IAsyncResult

        ''' <summary>
        ''' This methods return galleries for a media (async mode). 
        ''' </summary>
        ''' <param name="apiKey">You need a valid api key to use the API.</param>
        ''' <param name="id">Search by media id.</param>
        ''' <param name="thumbnail_size">The thumbnail size (30, 110, 400).</param>
        ''' <param name="language_id">The language id.</param>
        ''' <param name="acb">The async callback.</param>
        ''' <param name="state">The user state object.</param>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <XmlRpcBegin("xmlrpc.getMediaGalleries")>
        Function BeginGetMediaGalleries(apiKey As XmlRpc.Authentication, id As Integer, language_id As Integer, thumbnail_size As Integer, acb As AsyncCallback, state As Object) As IAsyncResult

        ''' <summary>
        ''' Ends the get media galleries.
        ''' </summary>
        ''' <param name="iasr">The async result.</param>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <XmlRpcEnd("xmlrpc.getMediaGalleries")>
        Function EndGetMediaGalleries(iasr As IAsyncResult) As XmlRpcStruct()
#End Region

#Region "xmlrpc.getMediaComp"
        ''' <summary>
        ''' This method returns comp images. 
        ''' Comp images can ONLY be used to evaluate the image as to suitability for a project, obtain client or internal company approvals, or experiment with layout alternatives. 
        ''' </summary>
        ''' <param name="apiKey">You need a valid api key to use the API.</param>
        ''' <param name="id">Media ID (ID of the Media whose you want to purchase a license).</param>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <XmlRpcMethod("xmlrpc.getMediaComp")>
        Function GetMediaComp(apiKey As XmlRpc.Authentication, id As Integer) As XmlRpcStruct

        ''' <summary>
        ''' This method returns comp images in async mode. 
        ''' Comp images can ONLY be used to evaluate the image as to suitability for a project, obtain client or internal company approvals, or experiment with layout alternatives. 
        ''' </summary>
        ''' <param name="apiKey">You need a valid api key to use the API.</param>
        ''' <param name="id">Media ID (ID of the Media whose you want to purchase a license).</param>
        ''' <param name="acb">The async callback.</param>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <XmlRpcBegin("xmlrpc.getMediaComp")>
        Function BeginGetMediaComp(apiKey As XmlRpc.Authentication, id As Integer, acb As AsyncCallback) As IAsyncResult

        ''' <summary>
        ''' This method returns comp images in async mode. 
        ''' Comp images can ONLY be used to evaluate the image as to suitability for a project, obtain client or internal company approvals, or experiment with layout alternatives. 
        ''' </summary>
        ''' <param name="apiKey">You need a valid api key to use the API.</param>
        ''' <param name="id">Media ID (ID of the Media whose you want to purchase a license).</param>
        ''' <param name="acb">The async callback.</param>
        ''' <param name="state">The user state object.</param>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <XmlRpcBegin("xmlrpc.getMediaComp")>
        Function BeginGetMediaComp(apiKey As XmlRpc.Authentication, id As Integer, acb As AsyncCallback, state As Object) As IAsyncResult

        ''' <summary>
        ''' Ends the get media comp.
        ''' </summary>
        ''' <param name="iasr">The iasr.</param>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <XmlRpcEnd("xmlrpc.getMediaComp")>
        Function EndGetMediaComp(iasr As IAsyncResult) As XmlRpcStruct
#End Region

#Region "xmlrpc.getMedia"
        ''' <summary>
        ''' This method allows to purchase a media and returns url to the purchased file.
        ''' </summary>
        ''' <param name="apiKey">You need a valid api key to use the API.</param>
        ''' <param name="id">Media ID (ID of the Media whose you want to purchase a license).</param>
        ''' <param name="license_name">Existing license name for this Media ID</param>
        ''' <returns>URL where you can download the purchased Media. This url must be kept hidden and is valid during 72 hours.</returns>
        ''' <remarks></remarks>
        <XmlRpcMethod("xmlrpc.getMedia")>
        Function GetMedia(apiKey As XmlRpc.Authentication, id As Integer, license_name As String) As XmlRpcStruct

        ''' <summary>
        ''' This method allows to purchase a media and returns url to the purchased file.
        ''' </summary>
        ''' <param name="apiKey">You need a valid api key to use the API.</param>
        ''' <param name="id">Media ID (ID of the Media whose you want to purchase a license).</param>
        ''' <param name="license_name">Existing license name for this Media ID</param>
        ''' <param name="acb">The async callback.</param>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <XmlRpcBegin("xmlrpc.getMedia")>
        Function BeginGetMedia(apiKey As XmlRpc.Authentication, id As Integer, license_name As String, acb As AsyncCallback) As IAsyncResult

        ''' <summary>
        ''' This method allows to purchase a media and returns url to the purchased file.
        ''' </summary>
        ''' <param name="apiKey">You need a valid api key to use the API.</param>
        ''' <param name="id">Media ID (ID of the Media whose you want to purchase a license).</param>
        ''' <param name="license_name">Existing license name for this Media ID</param>
        ''' <param name="acb">The async callback.</param>
        ''' <param name="state">The user state object.</param>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <XmlRpcBegin("xmlrpc.getMedia")>
        Function BeginGetMedia(apiKey As XmlRpc.Authentication, id As Integer, license_name As String, acb As AsyncCallback, state As Object) As IAsyncResult

        ''' <summary>
        ''' Ends the get media.
        ''' </summary>
        ''' <param name="iasr">The iasr.</param>
        ''' <returns></returns>
        ''' <remarks></remarks>
        <XmlRpcEnd("xmlrpc.getMedia")>
        Function EndGetMedia(iasr As IAsyncResult) As XmlRpcStruct
#End Region
    End Interface

End Namespace